/**
 * 
 */
package junior.util.model;

import junior.util.date.DateUtils;

import java.math.BigDecimal;
import java.text.ParseException;
import java.util.Date;
import java.util.List;

/**
 * @author bo.wu
 * @CreateDate 2015年3月17日
 */
public class Bean {
	private int id;
	private String name;
	private int number;
    private Integer[] groups;
	private Date date;
	private BigDecimal test;
    private List<String> codeList;
    private List<Integer[]> authList;
    private List<Integer>[] auth2List;
	public Bean() {}
	public Bean(int id, String name, int number) {
		this.id = id;
		this.name = name;
		this.number = number;
	}
	public Bean(int id, String name, int number, String dateText) {
		this(id, name, number);
		this.setDateText(dateText);
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getNumber() {
		return number;
	}
	public void setNumber(int number) {
		this.number = number;
	}
    
    public Integer[] getGroups() {
        return groups;
    }
    
    public void setGroups(Integer[] groups) {
        this.groups = groups;
    }
    
    public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
    public List<String> getCodeList() {
        return codeList;
    }
    public void setCodeList(List<String> codeList) {
        this.codeList = codeList;
    }
    
    public List<Integer[]> getAuthList() {
        return authList;
    }
    
    public void setAuthList(List<Integer[]> authList) {
        this.authList = authList;
    }
    
    public List<Integer>[] getAuth2List() {
        return auth2List;
    }
    
    public void setAuth2List(List<Integer>[] auth2List) {
        this.auth2List = auth2List;
    }
    
    public void setDateText(String text) {
        try {
            this.date = DateUtils.str2Date(text, "yyyy-MM-dd");
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
    public String getDateText() {
		return DateUtils.date2Str(date, "yyyy-MM-dd");
	}
	public String toString() {
		return "id: "+getId()+", name: "+getName()+", number: "+getNumber()+", date: "+getDateText();
	}
}
